package com.biz.primus.ms.commodity.dao.repository.evaluation;

import com.biz.primus.ms.base.jpa.repository.CommonJpaRepository;
import com.biz.primus.ms.commodity.dao.po.Evaluation;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.Collection;
import java.util.List;

/**
 * 评价repository
 *
 * @author yangzichun
 * @date 2017/2/8
 */
public interface EvaluationRepository extends CommonJpaRepository<Evaluation, Long>,
        JpaSpecificationExecutor<Evaluation>, EvaluationDao {
    //根据商品id查询所有该id对应的评价
    List<Evaluation> findByProductId(Long productId);

    //根据商品名称集合查询所有商品名称集合的评价
    List<Evaluation> findByVendorIdInOrderByIdAsc(Collection collection);

    //根据店铺名称集合查询所有店铺名称集合的评价
    List<Evaluation> findByProductInOrderByIdAsc(Collection collection);
}
